package aliyun

import (
	"context"
	"github.com/panshiqu/dysms"
)

type AliyunSmsService struct {
	accessKeyId  string
	accessSecret string
	signName     string
}

func NewService(accessKeyId, accessSecret, signName string) *AliyunSmsService {
	return &AliyunSmsService{
		accessKeyId:  accessKeyId,
		accessSecret: accessSecret,
		signName:     signName,
	}
}

func (s *AliyunSmsService) Send(ctx context.Context, phone string, templateCode string, templateParam string) error {
	return dysms.SendSms(s.accessKeyId, s.accessSecret, phone, s.signName, templateParam, templateCode)
}
